//
//  CXTestVC.m
//  DWBToolsDemo
//
//  Created by 周学丽 on 2025/4/17.
//  Copyright © 2025 潮汐科技有限公司. All rights reserved.
//

#import "CXTestVC.h"

@interface CXTestVC ()

@end

@implementation CXTestVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    dispatch_apply(10, dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^(size_t index) {
        // 并行执行10次，index从0到9
    });
    
//    NSURL *url1 = [NSURL URLWithString:@"/Users/username/Documents/example.txt"];
//    NSString *lastComponent = [url1 lastPathComponent];
//    NSLog(@"11==%@", lastComponent); // 输出: example.txt
//    
//    NSURL *url = [NSURL URLWithString:@"/Users/username/Documents/example.txt?name=John&age=30"];
//    NSString *lastComponent = [url lastPathComponent];
//    NSLog(@"%@", lastComponent); // 输出: example.txt
    

    NSString *jumpUrl = @"https://example.com/path?scheme=alipay&page=home";
    NSString *subStr = [jumpUrl substringFromIndex:[jumpUrl rangeOfString:@"?scheme="].location+[jumpUrl rangeOfString:@"?scheme="].length];
    NSLog(@"%@",subStr);//alipay&page=home
    

    
    
    NSLog(@"---->%@",[self URLDecodedString:subStr]);
    
    
    
    NSString *userInput = @"潮汐chaoxiABC";
    NSString *standardized = [userInput uppercaseString];
    NSLog(@"%@",standardized);//潮汐CHAOXIABC
    
}

- (NSString *)URLDecodedString:(NSString *)str{
    NSString *result = [str stringByReplacingOccurrencesOfString:@"+" withString:@" "];
    return [result stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
}
@end






